import request from "@/utils/request";


// 获取所有分类数据
export const getAllCategory = (() => {
    return request('/api/home/category/head', 'get')
})

/**
 * 获取单个顶级分类信息
 * @param {String} id - 顶级分类ID
 */
export const getTopCategory = (id) => {
    return request('/api/category', 'get', { id })
}


/**
 * 获取二级分类筛选条件数据
 * @param {String} id - 二级分类ID
 */
export const getSubCategoryFilter = (id) => {
    return request('/api/category/sub/filter', 'get', { id })
}


/**
 * 获取二级分类筛选条件数据
 * @param {String} id - 二级分类ID
 */
export const getSubCategoryGoods = (params) => {
    return request('/api/category/goods/temporary', 'post', params)
}